package com.test.ll;

public class InterFace {
	public static void main(String[] args){
		worker p1=new worker("liu","worker");
		nongmin p2=new nongmin("liang","nongmin");
		p1.eat();
		p1.play();
		p2.eat();
		p2.play();
	}
}

interface pet{
	void eat();
	void play();
}

class people{
	String name;
	String zhiye;

}

class worker extends people implements pet {
	worker(String n,String zy){
		this.name=n;
		this.zhiye=zy;
	}
	
	public void eat(){
		System.out.println("worker eat pet!");
	}
	public void play(){
		System.out.println("worker play pet!");
	}
}

class nongmin extends people implements pet {
	
	nongmin(String n,String zy){
		this.name=n;
		this.zhiye=zy;
	}
	
	public void eat(){
		System.out.println("nongmin eat pet!");
	}
	public void play(){
		System.out.println("nongmin play pet!");
	}
}
